#pragma once

#include "tv.h"
#include "air_conditioner.h"
#include "reflection.h"

//抽象工厂类EFactory（电器工厂类）
class EFactory{
public:
	virtual Television *produceTelevision() = 0;
	virtual AirConditioner *produceAirConditioner() = 0;
}; 


//具体工厂类HaierFactory（海尔工厂类）
class HaierFactory : public EFactory{
public:
	Television *produceTelevision(){
		return new HaierTelevision();
	}
	AirConditioner *produceAirConditioner(){
		return new HairAirConditioner();
	}
}; 
REGISTER(HaierFactory);//反射类注册


//具体工厂类TCLFactory（TCL工厂类）
class TCLFactory : public EFactory{
public:
	Television *produceTelevision(){
		return new TCLTelevision();
	}
	AirConditioner *produceAirConditioner(){
		return new TCLAirConditioner();
	}
};
REGISTER(TCLFactory);//反射类注册
